<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>Document</title>
    <link rel="stylesheet" href="../../css/mobiscroll.css">
    <link rel="stylesheet" href="../../css/mobiscroll_date.css">
    <link rel="stylesheet" href="../../css/ios_select.css">
    <link rel="stylesheet" href="../../css/api.css">
    <link rel="stylesheet" href="../../css/aui_font.css">
    <link rel="stylesheet" href="../../css/news.css">
    <link rel="stylesheet" href="../../css/tousu.css">
</head>

<body>
    <div id="view" v-cloak>
        <div class="text new-padding-10">
            {{_i18n('客服职责是为用户服务和维护平台秩序，如果你碰到了不负责任甚至以权谋私的情况，欢迎在此提交投诉')}}！<br />
            {{_i18n('只要情况属实，牵友交友一定秉公办理，所举报情节严重者将酌情给予现金奖励')}}。
        </div>
        <ul class="wrap dy-wrap">
            <p class="tip">{{_i18n('请提供相关资料，以便我们跟进核实')}}</p>
            <li class="list tu flex-col">
                <div class="title">{{_i18n('相关截图')}}</div>
                <div class="content">
                    <ul class="img-wrap flex-w">
                        <!-- <li class="i-list">
                            <div class="img img-h">
                                <img src="../../image/test/01.jpg" alt="">
                            </div>
                            <i class="aui-iconfont aui-icon-close"></i>
                        </li> -->
                        <li class="i-list" v-for="(m, index) in imgList">
                            <div class="img ">
                                <img :src="m" alt="">
                            </div>
                            <i class="aui-iconfont aui-icon-close" @click="delImg(index)"></i>
                        </li>
                        <li id="pic" class="i-list" onclick="selectFile();">
                            <div class="img img-h">
                                <img src="../../image/add.jpg" alt="">
                            </div>
                        </li>
                    </ul>
                </div>
            </li>
            <li class="list tu flex-col">
                <div class="title">{{_i18n('补充描述')}}</div>
                <div class="content">
                    <textarea name="" id="content"></textarea>
                </div>
            </li>
        </ul>
        <button class="new-submit" onclick="submit()">{{_i18n('提交')}}</button>
    </div>
</body>
<script src="../../script/api.js"></script>
<script src="../../script/jquery.js"></script>
<script src="../../script/ffkj.js"></script>
<script src="../../script/vue.js"></script>
<script>
    var view = new Vue({
        el: '#view',
        data: {
            imgurl: imgurl,
            ffList: [],
            ffInfo: {},
            ios: 1, // 1上架 0非上架

            selectId: 0,
            imgList: []
        },
        methods: {
            delImg(index) {
                view.imgList.splice(index, 1);
            },
            // 跳转
            _url(param, url) {
                _url(param, url);
            },
            // 返回图片路径
            returnImg(url) {
                return returnImg(url);
            },
            select(id) {
                var _this = this;
                _this.selectId = id;
            }
        }
    })
    apiready = function() {}

    // 选择图片
    function selectFile() {
        openPic(function(ret) {
            if (ret && ret.data) {
                view.imgList.push(ret.data);
            }
        })
    }

    // 确定
    function submit() {
        var content = $('#content').val();
        if (view.imgList.length == 0) {
            _msg('请上传相关截图');
            return;
        }
        _loading();
        _upImgs({
            image: view.imgList
        }, function(u) {
            putData(u);
        })
    }


    // 提交给后台
    function putData(diskImgArr) {
        var content = $('#content').val();
        _ajax('api/Member/complain', function(ret, err) {
            console.log(JSON.stringify(ret))
            console.log(JSON.stringify(err))
            var msg = ret.code == 200 ? '提交成功' : ret.msg;
            _loadingClose();
            _msg(msg);
            if (ret && ret.code == 200) {
                timerWin();
            }
        }, {
            user_id: $api.getStorage('userid'),
            images: diskImgArr,
            description: content
        })
    }
</script>

</html>